﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Argument.Models;

namespace Argument.Controllers
{
    public class QuickFindController : Controller
    {

        private ArgumentDbContext db = new ArgumentDbContext();

        //
        // GET: /QuickFind/

        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /QuickFind/Assertion

        [HttpPost]
        public ActionResult Assertion(FormCollection collection)
        {

            string search = collection.Get("searchText");

            return Json(db.Assertions.Where(ass => ass.Title.StartsWith(search)));

        }

    }
}
